import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import './plugins/element.js'
import 'normalize.css'
import '@/assets/css/mo.css'
import '@/assets/iconfont/iconfont.css'
import * as API from './http/api'


import mbx from '@/components/mbx.vue'
import moment from 'moment'
import  TreeTable from 'vue-table-with-tree-grid'
import * as echarts from 'echarts';
//引入vue-quill-editor富文本编辑器
import VueQuillEditor from 'vue-quill-editor'


//引入vue-quill-editor富文本编辑器css样式
import 'quill/dist/quill.core.css' // import styles
import 'quill/dist/quill.snow.css' // for snow theme
import 'quill/dist/quill.bubble.css' // for bubble theme

//注册
Vue.use(VueQuillEditor)
    // Vue.use(NProgress)
Vue.prototype.$echarts = echarts
Vue.component('tree-table', TreeTable)
Vue.component("mbx", mbx)
Vue.config.productionTip = false
Vue.prototype.$API = API

Vue.filter('time', function(value, formatString) {
        formatString = formatString || 'YYYY-MM-DD HH:mm:ss';
        return moment(value * 1000).format(formatString);
    })
    // Vue.filter('time', function(value) {
    //     const dt = new Date(value)

//     const y = dt.getFullYear()
//     const m = (dt.getMonth() + 1 + '').padStart(2, '0')
//     const d = (dt.getDate() + '').padStart(2, '0')

//     const hh = (dt.getHours() + '').padStart(2, '0')
//     const mm = (dt.getMinutes() + '').padStart(2, '0')
//     const ss = (dt.getSeconds() + '').padStart(2, '0')

//     return `${y}-${m}-${d} ${hh}:${mm}:${ss}`
//   })
Vue.filter('qxian', function(v) {
    let result
    switch (v * 1) {
        case 0:
            result = "一级权限"
            break;
        case 1:
            result = "二级权限"
            break;
        case 2:
            result = "三级权限";
            break;
        default:
            result = "没有权限"

    }
    return result
})

Vue.filter('spfl', function(v) {
    let result
    switch (v + '') {
        case "0":
            result = "一级权限"
            break;
        case "1":
            result = "二级权限"
            break;
        case "2":
            result = "三级权限";
            break;
        default:
            result = "没有权限"

    }
    return result
})

new Vue({
    router,
    store,
    render: h => h(App)
}).$mount('#app')